stylecontext: Remove get_pango_attributes
authorTimm Bäder <mail@baedert.org>
Sun, 12 Apr 2020 07:46:03 +0000 (09:46 +0200)
committerTimm Bäder <mail@baedert.org>
Fri, 17 Apr 2020 13:21:00 +0000 (15:21 +0200)
Make the only caller use GtkCssNode API.

gtk/gtkstylecontext.c
gtk/gtkstylecontextprivate.h
gtk/gtktext.c

index 15e0085537fd2589cb0ef53115fc71054289733f..64747619392b8692cd17cb5ec5316a025bd19e4c 100644 (file)
@@ -1408,12 +1408,6 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot     *snapshot,
     }
 }
 
-PangoAttrList *
-_gtk_style_context_get_pango_attributes (GtkStyleContext *context)
-{
-  return gtk_css_style_get_pango_attributes (gtk_style_context_lookup_style (context));
-}
-
 static AtkAttributeSet *
 add_attribute (AtkAttributeSet  *attributes,
                AtkTextAttribute  attr,
index f01adc5edbb419b0167b9c85568c4b08a0546c66..b0e675d80713c3686e29c6d5233becb2f635c54e 100644 (file)
@@ -53,8 +53,6 @@ void           _gtk_style_context_get_cursor_color           (GtkStyleContext
                                                               GdkRGBA            *primary_color,
                                                               GdkRGBA            *secondary_color);
 
-PangoAttrList *_gtk_style_context_get_pango_attributes       (GtkStyleContext *context);
-
 /* Accessibility support */
 AtkAttributeSet *_gtk_style_context_get_attributes           (AtkAttributeSet    *attributes,
                                                               GtkStyleContext    *context);
index 311a3e7246e7e8c989da3e3f03c7c89a138b0b6a..c5049614ac7f10b2c6b449b6bd20c884bfc9a549 100644 (file)
@@ -4334,7 +4334,6 @@ gtk_text_create_layout (GtkText  *self,
 {
   GtkTextPrivate *priv = gtk_text_get_instance_private (self);
   GtkWidget *widget = GTK_WIDGET (self);
-  GtkStyleContext *context;
   PangoLayout *layout;
   PangoAttrList *tmp_attrs;
   char *preedit_string = NULL;
@@ -4343,12 +4342,10 @@ gtk_text_create_layout (GtkText  *self,
   char *display_text;
   guint n_bytes;
 
-  context = gtk_widget_get_style_context (widget);
-
   layout = gtk_widget_create_pango_layout (widget, NULL);
   pango_layout_set_single_paragraph_mode (layout, TRUE);
 
-  tmp_attrs = _gtk_style_context_get_pango_attributes (context);
+  tmp_attrs = gtk_css_style_get_pango_attributes (gtk_css_node_get_style (gtk_widget_get_css_node (widget)));
   tmp_attrs = _gtk_pango_attr_list_merge (tmp_attrs, priv->attrs);
   if (!tmp_attrs)
     tmp_attrs = pango_attr_list_new ();